package kr.pe.johnkim.checkmileage.mobile.rest.service;

import kr.pe.johnkim.checkmileage.mobile.domain.CheckMileageCertification;
import kr.pe.johnkim.checkmileage.mobile.rest.dao.CheckMileageCertificationDaoImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Check Mileage 인증 번호 관련 Service 기능들을 구현하는 클래스 이다.
 *
 * @author : johnkim <cale9797@gmail.com / Bettersoft, Inc.>
 * @Date : 12. 8. 3
 */
public class CheckMileageCertificationServiceImpl implements CheckMileageCertificationService {

    // SLF4J Logging
	private Logger logger = LoggerFactory.getLogger(CheckMileageCertificationServiceImpl.class);

    @Autowired
    private CheckMileageCertificationDaoImpl checkMileageCertificationDao = null;

    /**
     * 인증번호를 등록 한다.
     *
     * @param checkMileageCertification
     */
    @Override
    public void registerCertification(CheckMileageCertification checkMileageCertification) {
        logger.info("registerCertification");
        checkMileageCertificationDao.registerCertification(checkMileageCertification);
    }

    /**
     * 해당 사용자의 인증 정보가 있는지 확인 한다.
     *
     * @param checkMileageCertification
     * @return
     */
    @Override
    public CheckMileageCertification selectExistCertificationInformation(CheckMileageCertification checkMileageCertification) {
        logger.info("selectExistCertificationInformation");
        return checkMileageCertificationDao.selectExistCertificationInformation(checkMileageCertification);
    }

    /**
     * 해당 사용자의 인증 정보를 가져 온다.
     *
     * @param checkMileageCertification
     * @return
     */
    @Override
    public CheckMileageCertification selectCertificationInformation(CheckMileageCertification checkMileageCertification) {
        logger.info("selectCertificationInformation");
        return checkMileageCertificationDao.selectCertificationInformation(checkMileageCertification);
    }

    /**
     * 해당 인증 정보를 비활성화 한다.
     *
     * @param checkMileageCertification
     */
    @Override
    public void updateDeactivateCertification(CheckMileageCertification checkMileageCertification) {
        logger.info("updateDeactivateCertification");
        checkMileageCertificationDao.updateDeactivateCertification(checkMileageCertification);
    }
}
